﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class test : MonoBehaviour
{

    public Transform t_trans;
    public float speed = 5f;
    BattleObject bObject;
    // Start is called before the first frame update
    void Start()
    {
        t_trans = gameObject.GetComponent<Transform>();
        bObject=gameObject.AddComponent<BattleObject>();
        bObject.setEnemy();
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKey(KeyCode.W))
        {
            t_trans.Translate(Vector3.up * speed * Time.deltaTime, Space.Self);
        }
        if (Input.GetKey(KeyCode.A))
        {
            t_trans.Translate(Vector3.left * speed * Time.deltaTime, Space.Self);
        }
        if (Input.GetKey(KeyCode.S))
        {
            t_trans.Translate(Vector3.down * speed * Time.deltaTime, Space.Self);
        }
        if (Input.GetKey(KeyCode.D))
        {
            t_trans.Translate(Vector3.right * speed * Time.deltaTime, Space.Self);
        }
    }
}
